<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script language="javascript" type="text/javascript" src="http://www.ucmaim.com/Public/Ucmaim/Admin/js/jquery.js"></script>
<script src="http://www.ucmaim.com/Public/Ucmaim/Admin/js/frame.js" language="javascript" type="text/javascript"></script>
<link href="http://www.ucmaim.com/Public/Ucmaim/Admin/css/style.css" rel="stylesheet" type="text/css" />

<!--[if IE 6]>
<script src="http://www.ucmaim.com/Public/Ucmaim/Admin/js/DD_belatedPNG.js" language="javascript" type="text/javascript"></script>
<script>
  DD_belatedPNG.fix('.nav ul li a,.top_link ul li,background');   /* string argument can be any CSS selector */
</script>
<![endif]-->
</head>
<body class="showmenu">
<table width="100%" height="31px" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
      <tr>
        <td height="31">
			<div class="titlebt">
				<?php if(I('get.do')=='add'): ?>添加栏目
				<?php else: ?>
					修改栏目<?php endif; ?>
			</div>
		</td>
      </tr>
    </table>

<div class="main">

	<div class="form">
		<?php $do = I('get.do'); ?>
		<form method='post' id="form_do" name="form_do" enctype="multipart/form-data" action="<?php echo U('Admin/Category/category', 'do='.$do);?>">

		<dl>
			<dt> 所属栏目：</dt>
			<dt>
				<?php if($result["gc_id"] != ''): ?><div style="width:80px; background:#079B04; color:#FFFFFF" align="center"><?php echo ($result["gc_name"]); ?></div>
                    <input type="hidden" name="lanmu" value="<?php echo ($result["gc_id"]); ?>">
                <?php else: ?>
                    <div style="width:80px; background:#079B04; color:#FFFFFF" align="center">顶级分类</div><?php endif; ?>
			</dt>
		</dl>

		<dl>
			<dt><span style="color:red;">*</span> 栏目名称：</dt>
			<dd>
				<input type="text" name="gc_name" class="inp_one" value="<?php echo ($cate["gc_name"]); ?>" />
			</dd>
		</dl>

        <dl>
            <dt>首字母</dt>
            <dd>
                <input type="text" name="firstname" value="<?php echo ($cate["gc_firstname"]); ?>" class="inp_one" placeholder="不填默认自动生成">
            </dd>
        </dl>

        <dl>
            <dt> 栏目关系：</dt>
            <if>
	            <span><?php if(is_array($result['goods_relation'])): $i = 0; $__LIST__ = $result['goods_relation'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i; echo ($vo["gc_name"]); ?>><?php endforeach; endif; else: echo "" ;endif; ?></span>
	            <input type="hidden" name="relation" class="inp_one" value="<?php echo ($result["gc_relation"]); echo ($result["gc_id"]); ?>"/>
            </dd>
        </dl>

		<dl>
			<dt> 排序：</dt>
			<dd>
				<input type="number" name="sort" class="inp_one" value="<?php echo ($cate["gc_sort"]); ?>" placeholder="默认值0"/>
			</dd>
		</dl>

        <dl>
            <dt> 图片上传：</dt>
            <dd>
                <input type="text" name="name" style="display: none;" /><input type="file" name="photo" />
                <?php if($cate['gc_pic']): ?><div id="gallery" style="margin-left:140px;"><a class="photo" href="<?php echo 'http://'.$_SERVER['SERVER_NAME']; ?>/Application/Ucmaim/Uploads/<?php echo ($cate["gc_pic"]); ?>"><img src="<?php echo 'http://'.$_SERVER['SERVER_NAME']; ?>/Application/Ucmaim/Uploads/<?php echo ($cate["gc_pic"]); ?>" width="200" height="100"></a></div><?php endif; ?>
            </dd>
        </dl>

		<div class="form_b">
            <input type="hidden" value="<?php echo ($id); ?>" name="id">
			<input type="submit" class="btn_blue" id="submit" value="提 交">
		</div>
	   </form>
	</div>
</div>
<script src="http://www.ucmaim.com/Public/Ucmaim/Admin/js/jquery.poptrox.min.js"></script>
<script>$(function(){$('#gallery').poptrox({usePopupCaption:true})});</script>

</body>
</html>